package org.cpar.compiler.nodes;

import org.antlr.runtime.Token;
import org.antlr.runtime.tree.Tree;
import org.cpar.compiler.CPARNode;
import org.cpar.compiler.ICodeWriter;

public class MonitorCall extends CPARNode {

	public String getMonitorName() {
		return getText();
	}

	public CPARNode getFunctionCall() {
		return (CPARNode) getChild(0);
	}
	
	public String getFunctionCallName(){
		return getFunctionCall().getText();
	}

	public MonitorCall(MonitorCall c) {
		super(c);
	}

	public MonitorCall(Token nextToken) {
		super(nextToken);
	}

	@Override
	public Tree dupNode() {
		return new MonitorCall(this);
	}
	
	@Override
	public void accept(ICodeWriter writer) {
		writer.visit(this);
	}
}
